﻿using TemplatesPrint.DBHelper;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TemplatesPrint.Entitys
{
    [SugarTable("CodeInfos")]
    public class CodeInfoEntity : BaseEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Barcode { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Type { get; set; }

        [SugarColumn(IsNullable = true)]
        public string MsgId { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Source { get; set; }

        [SugarColumn(IsNullable = true)]
        public string Status { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(Status))]//一对一
        public CodeStatusDicEntity StatusDic { get; set; }

        [SugarColumn(IsIgnore = true)]
        public string StatusName { get { return StatusDic.Name; } }

    }
}
